<?php echo $this->render('front_header.phtml'); 

if($this->new_id>0) {
    echo 'Вы успешно зарегистрировались.';
} else {
?>
<link type="text/css" rel="stylesheet" href="/public/js_calendar/dhtmlgoodies_calendar.css" media="screen"></LINK>
<script type="text/javascript" src="/public/js_calendar/dhtmlgoodies_calendar.js"></script>
<form action="/join" method="post">
  <fieldset>
  <?php if(!empty($this->message)) :?>
    <dl id="message">
        <dt></dt>
        <dd><b style="color:red;"><?php echo $this->escape($this->message);?></b></dd>
    </dl>
    <?php endif; ?>
    <dl>
        <dt><label for="email">First Name</label></dt>
        <dd><input type="text" size="54" id="first_name" name="first_name" value="<?php echo $this->escape(trim($this->f_user->first_name));?>"></dd>
    </dl>
    
    <dl>
        <dt><label for="email">Last name</label></dt>
        <dd><input type="text" size="54" id="last_name" name="last_name" value="<?php echo $this->escape(trim($this->f_user->last_name));?>"></dd>
    </dl>
    
    <dl>
        <dt><label for="password">Bithday</label></dt>
        <dd><input type="text" size="10" id="birthday" name="birthday" value="<?php echo $this->escape(trim($this->f_user->birthday));?>">
        <img id="birthday_trigger" src="/public/images/cal.gif" style="padding:6px;" onclick="displayCalendar(document.getElementById('birthday'),'yyyy-mm-dd',this);"></dd>
    </dl>            
            
    <dl>
        <dt><label for="address">Address</label></dt>
        <dd><input type="text" size="54" id="address" name="address" value="<?php echo $this->escape(trim($this->f_user->address));?>"></dd>
    </dl>
    
    <dl>
        <dt><label for="contacts">Skype</label></dt>
        <dd><input type="text" size="54" id="contacts" name="contacts" value="<?php echo $this->escape(trim($this->f_user->contacts));?>"></dd>
    </dl>
    
    <dl>
        <dt><label for="email">Email</label></dt>
        <dd><input type="text" size="54" id="email" name="email" value="<?php echo $this->escape(trim($this->f_user->email));?>"></dd>
    </dl>
    
    <dl>
        <dt><label for="phone">Phone</label></dt>
        <dd><input type="text" size="54" id="phone" name="phone" value="<?php echo $this->escape(trim($this->f_user->phone));?>"></dd>
    </dl>
    
    <dl>
        <dt><label for="preference">Preference</label></dt>
        <dd>
            <select id="preference" name="preference" size="1">
                <?php foreach($this->preferences as $key=>$value) { ?> 
                <option value="<?php echo $key;?>" <?php echo $this->escape(trim($this->f_user->preference))==$key?' selected ':'';?>><?php echo $value;?></option>
                <?php } ?>
            </select>
        </dd>
    </dl>
    
    <dl class="submit">
        <a href="javascript:document.forms[0].submit();" class="bt_blue"><span class="bt_blue_lft"></span><strong>Save</strong><span class="bt_blue_r"></span></a>
        <a href="/" class="bt_blue"><span class="bt_blue_lft"></span><strong>Cancel</strong><span class="bt_blue_r"></span></a>
     </dl>
  </fieldset>         
</form>
<?php } ?>
<?php echo $this->render('front_footer.phtml'); ?>